import base64

# 'abc'  01010101  ==  encoding
res = 'abc'.encode('utf8')
print(res)
#       b'abc'
#     < bytes >

#   再转写
rres = base64.b64encode(res)
print(rres)
print(type(rres))
#     b'YWJj'
#    <class 'bytes'>

r = rres.decode('utf8')
print(r)
# print(type(r))
#   #     YWJj
#   # <class 'str'>
#
# code = r.encode('utf8')
# print('code-->',code)




bbres = base64.b64decode(r).decode('utf8')
print(bbres)
#   abc

# bres = base64.b64decode(rres)
# print(bres)
# #      b'abc'








